package com.mscsoft.brainpower.server.domain;

public class Msg<T> {
    private int code;

    private String message;

    private T data;

    public Msg() {
        this.code = 200;
        this.message = "OK";
    }

    public Msg(T data) {
        this.code = 200;
        this.message = "OK";
        this.data = data;
    }

    public Msg(int code, String msg) {
        this.code = code;
        this.message = msg;
    }

    public Msg(int code, String msg, T data) {
        this.code = code;
        this.message = msg;
        this.data = data;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return message;
    }

    public void setMsg(String msg) {
        this.message = msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public static final String s400 = "Bad Request";
    public static final String s401 = "Unauthorized";
    public static final String s403 = "Forbidden";
    public static final String s422 = "Unprocessable Entity";
    public static final String s500 = "Internal Server Error";

}